/*
 * TarifasHelper.java
 *
 * Created on 17 de mayo de 2007, 08:59 AM
 *
 * To change this template, choose Tools | Options and locate the template under
 * the Source Creation and Management node. Right-click the template and choose
 * Open. You can then make changes to the template in the Source Editor.
 */

package com.src.computec.facturacion.tarifas.helper;

import com.src.computec.facturacion.base.helper.BaseHelper;
import com.src.computec.facturacion.noclass.dto.DepartamentoDto;
import com.src.computec.facturacion.tarifas.dao.BaseTarifaNodoDAO;
import com.src.computec.facturacion.tarifas.exception.TarifasException;
import com.src.computec.radar.base.dao.exception.DAOException;
import java.util.List;

/**
 *
 * @author FSanchez
 */
public class TarifasHelper extends BaseHelper {
    
    
    /** Creates a new instance of TarifasHelper */
    public TarifasHelper() {
        
    }
    
   public List getAllTarifasNodo() throws TarifasException  {
        BaseTarifaNodoDAO dao = (BaseTarifaNodoDAO) this.getFactoryDAO().getTarifaNodoDAO();
        try {
            return dao.getAllTarifaNodos();
        }
        catch (DAOException e) {
            throw new TarifasException("TarifasHelper:getAllTarifasNodo: " + e.toString());
        }
    }
   
   public List getTarifasByNodo(String pNodo,String pTipoTarifa) throws TarifasException  {
        BaseTarifaNodoDAO dao = (BaseTarifaNodoDAO) this.getFactoryDAO().getTarifaNodoDAO();
        try {
            return dao.getTarifaByNodos(pNodo,pTipoTarifa);
        }
        catch (DAOException e) {
            throw new TarifasException("TarifasHelper:getTarifasByNodo: " + e.toString());
        }
    }

    public String getTarifaByMunCentroP(List pFilters) throws TarifasException {
        BaseTarifaNodoDAO dao = (BaseTarifaNodoDAO) this.getFactoryDAO().getTarifaNodoDAO();
        try {
            return dao.getTarifaByMunCentroP(pFilters);
        }
        catch (DAOException e) {
            throw new TarifasException("TarifasHelper:getTarifaByMunCentroP: " + e.toString());
        }
    }
    
    public void updateTarifaNodo(List pFilters) throws TarifasException{
        BaseTarifaNodoDAO dao = (BaseTarifaNodoDAO) this.getFactoryDAO().getTarifaNodoDAO();
        try {
            dao.updateTarifaNodo(pFilters);
        }
        catch (DAOException e) {
            throw new TarifasException("TarifasHelper:updateTarifaNodo: " + e.toString());
        }
    }

    public boolean insertTipoTarifa(String pDescripcion) throws TarifasException{
        BaseTarifaNodoDAO dao = (BaseTarifaNodoDAO) this.getFactoryDAO().getTarifaNodoDAO();
        try {
            return dao.insertTipoTarifa(pDescripcion);
        }
        catch (DAOException e) {
            throw new TarifasException("TarifasHelper:insertTipoTarifa: " + e.toString());
        }
    }
    
     public int[] updateAllTarifaNodo(List pTarifas,String pCodTipoTarifa,String pCodNodo) throws TarifasException{
        BaseTarifaNodoDAO dao = (BaseTarifaNodoDAO) this.getFactoryDAO().getTarifaNodoDAO();
        try {
            return dao.updateAllTarifaNodo(pTarifas,pCodTipoTarifa,pCodNodo);
        }
        catch (DAOException e) {
            throw new TarifasException("TarifasHelper:updateAllTarifaNodo: " + e.toString());
        }
    }
     
     public boolean insertAllNodoIntoTarifaNodo(String pCodNodo) throws TarifasException{
        BaseTarifaNodoDAO dao = (BaseTarifaNodoDAO) this.getFactoryDAO().getTarifaNodoDAO();
        try {
            return dao.insertAllNodoIntoTarifaNodo(pCodNodo);
        }
        catch (DAOException e) {
            throw new TarifasException("TarifasHelper:updateAllTarifaNodo: " + e.toString());
        }
    }
     
      public int insertTryNodoIntoTarifaNodo(String pNodo) throws TarifasException{          
        BaseTarifaNodoDAO dao = (BaseTarifaNodoDAO) this.getFactoryDAO().getTarifaNodoDAO();
        try {
            return dao.insertTryNodoIntoTarifaNodo(pNodo);
        }
        catch (DAOException e) {
            throw new TarifasException("TarifasHelper:insertTryNodoIntoTarifaNodo: " + e.toString());
        }          
      }
      
      public void insertNodoIntoTarifaNodo(List pFilters) throws TarifasException{          
        BaseTarifaNodoDAO dao = (BaseTarifaNodoDAO) this.getFactoryDAO().getTarifaNodoDAO();
        try {
            dao.insertNodoIntoTarifaNodo(pFilters);
        }
        catch (DAOException e) {
            throw new TarifasException("TarifasHelper:insertNodoIntoTarifaNodo: " + e.toString());
        }          
      }
      
      public int deleteAllTarifaNodo(List pTarifas,String pCodTipoTarifa,String pCodNodo) throws TarifasException{          
        BaseTarifaNodoDAO dao = (BaseTarifaNodoDAO) this.getFactoryDAO().getTarifaNodoDAO();
        try {
            return dao.deleteAllTarifaNodo(pTarifas, pCodTipoTarifa, pCodNodo);
        }
        catch (DAOException e) {
            throw new TarifasException("TarifasHelper:deleteAllTarifaNodo: " + e.toString());
        }          
      }
}
